var href = decodeURI(location.href)
    console.log(href);

var oul = document.querySelector(".productList")

fetch("http://chst.vip:1234/api/getmoneyctrl")
.then(data=>{
    return data.json();
})
.then(res=>{
    console.log(res);
    console.log(res.result);
    let ele1 = "";
    let regExp = /(?<=imgurl=)[^'"]*/;
    res.result.forEach(item => {
        var img = regExp.exec(item.productImg2)[0]
        console.log(item.productId);
        ele1 += `<li class="list">
                    <a href="../pages/discount.html?productid=${item.productId}">
                    <img src="${img}" alt="">
                    <div class="list_right">
                        <h4>${item.productName}</h4>
                        <div class="list_bottom">
                            <span>${item.productFrom}|${item.productTime}</span>
                            <i>${item.productComCount}</i>
                        </div>
                    </div>
                    </a>
                </li>`
    });
    oul.innerHTML = ele1
    console.log(oul);
})